package com.yb.nowcoder;

import java.util.Scanner;

/**
 * 华为机试练习第5题
 */
public class Main5 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextLine()) {
            String s = in.nextLine();
            s = s.replace("0x", "");
            System.out.println(Integer.parseInt(s, 16));
        }
    }
}
